import {commonParams} from './config.js'
import axios from 'axios'

export function getRecommend() {
    const url = '/api/getRecommend'
    const data = Object.assign({},commonParams,{
        uin: 0,
        notice: 0,
        platform: 'h5',
        needNewCode: 1,
        _:1503120655346,
        format: 'json'
    })
    return axios.get(url,{
        params: data
    }).then((res) => {
        return Promise.resolve(res.data)
    })
}

export function getSongList (disstid) {
    const url = '/api/getSongList'
    const data = Object.assign({},commonParams,{
        disstid,
        uin: 0,
        type: 1,
        json: 1,
        utf8: 1,
        onlysong: 0,
        platform: 'h5',
        needNewCode:1,
        format: 'json',
        g_tk:5381
    })
    return axios.get(url,{
        params: data
    }).then((res) => {
        return Promise.resolve(res.data)
    })
}